package com.heima.feigns.behavior;

import com.heima.model.behavior.dtos.ApArticleRelationDto;
import com.heima.model.behavior.pojos.ApBehaviorEntry;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @ClassName BehaviorFeign
 * @Description TODO
 * @Author AWei
 * @DATE 2021/4/23 0:09
 * @Version 1.0
 */
@FeignClient("leadnews-behavior")
public interface BehaviorFeign {

    /**
     * @Description 查询行为实体
     * @param userId app用户id
     * @param equipmentId 设备id
     * @return 查询结果
     */
    @GetMapping("/api/v1/behavior_entry/one")
    ApBehaviorEntry findByUserIdOrEquipmentId(@RequestParam("userId") Integer userId, @RequestParam(value = "equipmentId",required = false
    ) Integer equipmentId);

    @PostMapping("/api/v1/article_relation/one")
    Map findApArticleRelation(@RequestBody ApArticleRelationDto dto);
}
